import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-03-26
 * Time: 18:37
 */
public class test5 {
    public static void swap(int[] nums){
        for(int i=0;i< nums.length-1;i+=2){
            int tmp = nums[i];
            nums[i] = nums[i+1];
            nums[i+1] = tmp;
        }
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        swap(arr);
        System.out.println(Arrays.toString(arr));
    }
}
